package com.jy.api.dao;

import com.jy.api.domain.DiscountOrderItem;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Date;
import java.util.List;

public interface DiscountOrderItemDao   extends JpaRepository<DiscountOrderItem, Integer>, JpaSpecificationExecutor<DiscountOrderItem> {




 //  DiscountOrderItem  findByOrderIdAndProductId(String orderId,String productId);

    List<DiscountOrderItem>   findByOrderIdAndProductId(String orderId,String productId);




    List<DiscountOrderItem>  findByOrderId(String orderId);


    Page<DiscountOrderItem> findAllByPromotionIdAndPayTimeBetween(int promotionId, Date parse, Date parse1, Pageable pageable);

    Page<DiscountOrderItem>  findAllByPromotionId(int promotionId, Pageable pageable);
}
